<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            font-size: 32px;
            overflow-y: hidden;
        }
        /* 核心样式 */
        .main {
            scroll-snap-type: y mandatory;
            /* 需要把滚动条设置到父容器 
               scroll-snap-type 才能生效
               默认是在body上 现在是在 main 上
            */
            overflow: scroll;
            height: 100vh;
        }
        section {
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            scroll-snap-align: start;
        }
        .bg_o {
            background-color: orange;
        }
        .bg_t {
            background-color: tomato;
        }
        .bg_l {
            background-color: lightblue;
        }
        .bg_p {
            background-color: pink;
        }
    </style>
</head>
<body>
    <div class="main">
        <section class="bg_o">页面内容1</section>
        <section class="bg_t">页面内容2</section>
        <section class="bg_l">页面内容3</section>
        <section class="bg_p">页面内容4</section>
    </div>
</body>
<script>
</script>
</html>